function toggleSidebar() {
	var sidebarOpen = document.getElementById("sidebar-open");
	var sidebarClose = document.getElementById("sidebar-close");
	
	var display = sidebarOpen.style.display;
	if (display == "none") {
		sidebarOpen.style.display = "block";
		sidebarClose.style.visibility = "hidden";
	} else {
		sidebarOpen.style.display = "none";
		sidebarClose.style.visibility = "visible";
	}
}

function toggleBroadeningFacet(facetID) {
	var showControl = document.getElementById(facetID + "-show-broadening-facet");
	var hideControl = document.getElementById(facetID + "-hide-broadening-facet");
	
	var display = showControl.style.display;
	if (display == "none") {
		showControl.style.display = "block";
		hideControl.style.display = "none";
	} else {
		showControl.style.display = "none";
		hideControl.style.display = "block";
	}
}

function getTarget(e) {
	if (!e) {
		var e = window.event;
	}
	
	if (e.target) {
	   targ = e.target;
	} else if (e.srcElement) {
	   targ = e.srcElement;
	}
	return targ;
}

function slide(propertyURI, forward) {
	var url = g_slidingURL + "&-=" +
		encodeURIComponent(
			"@lwq.project.PropertyProjector;" + (forward ? "!" : "") + propertyURI + ";" +
			"@lwq.bucket.NestedQueryBucketer;" + g_slidingQuery);
			
	browseTo(url);
}

function hop(pseudoURI, propertyURI, forward) {
	var url = g_slidingURL + "&-=" +
		encodeURIComponent(
			"@lwq.project.PropertyProjector;" + (forward ? "!" : "") + propertyURI + ";" +
			"@lwq.bucket.DistinctValueBucketer;r" + pseudoURI);
			
	browseTo(url);
}
